package com.sh.data.engine.domain.dataquality.model.domain;

import com.sh.data.engine.repository.dao.dataquality.entity.DataQualityRuleTemplateEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author tinglan.ys
 * @description:
 * @date 2022/2/18 下午4:32
 */
@Data
//@ApiModel
public class DataQualityRuleTemplateDomain extends DataQualityRuleTemplateEntity {

    //    @ApiModelProperty(value = "规则条件")
    private List<RuleCondition> ruleConditions;

    //    @ApiModelProperty(value = "比较方式集合")
    private List<CompareType> compareTypes;

    //    @ApiModelProperty(value = "期望值")
    private ExpectValue expectValue;

    @Data
//    @ApiModel
    public static class RuleCondition {

        //    @ApiModelProperty(value = "字段名")
        private String name;

        //    @ApiModelProperty(value = "输入项，可能有多个")
        private List<RuleConditionItem> items;
    }

    @Data
    public static class RuleConditionItem {

        //    @ApiModelProperty(value = "字段key")
        private String key;

        //    @ApiModelProperty(value = "说明")
        private String placeholder;

        //    @ApiModelProperty(value = "输入框类型", allowableValues = "text,number,date")
        private String dataType;
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
//    @ApiModel
    public static class CompareType {
        //    @ApiModelProperty(value = "比较方式值")
        private Integer compareType;

        //    @ApiModelProperty(value = "比较方式名")
        private String desc;
    }

    @Data
    public static class ExpectValue {

        //    @ApiModelProperty(value = "输入框类型", allowableValues = "text,number,date,datetime")
        private String dataType;
    }
}
